{% load i18n fb_tags %}
<nav class="grp-pagination">
    <header style="display:none"><h1>Pagination</h1></header>
    <ul class="grp-horizontal-list">
        {% if filelisting.results_current %}
            {% if query.q or query.filter_date or query.filter_type or query.type %}
                <li class="grp-results"><span>{{ filelisting.results_current }} {% if filelisting.results_current == 1 %}{% trans 'result' %}{% else %}{% trans 'results' %}{% endif %}</span></li>
            {% endif %}
        {% endif %}
        <li class="grp-results">
            {% if query.q or filelisting.results_total != filelisting.results_current %}
            <a href="{% query_string "" "filter_date,filter_type,p,q,type" %}" class="total">{{ filelisting.results_total }} {% trans 'total' %}</a>
            {% else %}
            <span>{{ filelisting.results_total }} {% trans "total" %}</span>
            {% endif %}
        </li>
        {% if page_range %}
            {% for i in page_range %}
                {% if not i|floatformat %}
                    <li class="grp-separator"><span>...</span></li>
                {% else %}
                    {% if i == page_num %}
                        <li><span class="this-page">{{ i|add:"1" }}</span></li>
                    {% else %}
                        <li><a href="{% query_string "" "p" %}&amp;p={{ i|add:"1" }}">{{ i|add:"1" }}</a></li>
                    {% endif %}
                {% endif %}
            {% endfor %}
        {% endif %}
    </ul>
</nav>
